<template>
  <div class="about">
    <h1>This is an about page</h1>
    <h1>{{this.$store.state.name}}</h1>
    <h1>{{this.$store.state.a.name}}</h1>
    <h1>{{$store.state.msg}}</h1>
    <button @click="btn"> 修改名字</button>
    <p>
      <button @click="btnMsg">修改信息</button>
    </p>
    <p>
      {{"出道年龄:"+ages}}
      <!-- {{this.$store.state.age}} -->
    </p>
  </div>
</template>

<script>
export default {
  computed:{
    ages(){
      return this.$store.getters.changeAge
    }
  },
  methods:{
    btn(){
      this.$store.commit("changeName","张三666")
    },
    btnMsg(){
      // this.$store.commit("changeMsg","张三的信息已经修改完毕")
      this.$store.dispatch('yibu',"张三的信息已经修改完毕")
    }
  }
}
</script>
